/*!
 * jquery.scrollto.js 0.0.1 - https://github.com/yckart/jquery.scrollto.js
 * Scroll smooth to any element in your DOM.
 *
 * Copyright (c) 2012 Yannick Albert (http://yckart.com)
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
 * 2013/02/17
 **/
$.scrollTo = $.fn.scrollTo = function(x, y, options){
    if (!(this instanceof $)) return $.fn.scrollTo.apply($('html, body'), arguments);

    options = $.extend({}, {
        gap: {
            x: 0,
            y: 0
        },
        animation: {
            easing: 'swing',
            duration: 600,
            complete: $.noop,
            step: $.noop
        }
    }, options);

    return this.each(function(){
        var elem = $(this);
        elem.stop().animate({
            scrollLeft: !isNaN(Number(x)) ? x : $(y).offset().left + options.gap.x,
            scrollTop: !isNaN(Number(y)) ? y : $(y).offset().top + options.gap.y
        }, options.animation);
    });
};
$(function(){
		$('.arrow').live('click', function(){
			alert("11111");
			var $this = $(this),
			
			href = $this.attr('href'),
			
			$target = $(href);
				
			if($target.size()){
			
				eTop = $target.offset().top;

			}else{
			
				return false;
			
			}
			//$(document).scrollTop(eTop);
			$('body').scrollTo(eTop, 300, { easing:'swing', axis:'y' });
			
			$('.arrow').removeClass('active');
			
			$this.addClass('active');
			
			return false;
		});
		
		$('[arrowid]').live('mouseover',function(){
		
			var arrowid = $(this).attr('arrowid'),
			
			$arrow = $('.arrow').removeClass('active');
			
			$arrow.filter('[href=#' + arrowid + ']').addClass('active');
			
		}).live('mouseout',function(){
		
			$arrow = $('.arrow').removeClass('active');
		
		});
		
	});